package com.mytrip.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.mytrip.base.annotation.model.Entity;
import com.mytrip.util.MD5Support;

/**
 * 后台用户
 * 
 * @author xz
 * 
 */
@Entity(id = "id")
public class BackOperator extends BaseModelAdapter{

	/**
	 * 
	 */
	public static final Integer END_USER_STATUS_YX = 1;

	public static final Integer END_USER_STATUS_WX = 0;

	private static final long serialVersionUID = 2116957310521287479L;

	private Long id;

	private String userName;

	private String password;

	private Role role;

	private String realName;

	private Integer operatorStatus;

	private String secretCode;

	private String phone;

	private String email;

	private Date createTime;

	private Integer isDeptLeader = 0;

	private String merchantIdStr;

	private Integer merchantAllFlag = FLAG_NO;// 拥有所有商家标志

	private Integer mcSiteId;

	private Integer userType;

	private Integer categoryAllFlag;// 拥有所有分类标志

	private List<Long> categoryIdsList = new ArrayList<Long>();

	private Integer adminSiteId = -1;

	private Integer currentSiteId = -1;

	private List<Module> moduleList;

	private List<Role> roleList;

	private String properties;// 个性化属性

	private Long creatorId;// 创建者ID

	private Integer staffNo;

	public Integer getStaffNo(){
		return staffNo;
	}

	public void setStaffNo(Integer staffNo){
		this.staffNo = staffNo;
	}

	public String getProperties(){
		return properties;
	}

	public void setProperties(String properties){
		this.properties = properties;
	}

	public Long getCreatorId(){
		return creatorId;
	}

	public void setCreatorId(Long creatorId){
		this.creatorId = creatorId;
	}

	public List<Role> getRoleList(){
		return roleList;
	}

	public void setRoleList(List<Role> roleList){
		this.roleList = roleList;
	}

	public List<Module> getModuleList(){
		return moduleList;
	}

	public void setModuleList(List<Module> moduleList){
		this.moduleList = moduleList;
	}

	public Integer getIsDeptLeader(){
		return isDeptLeader;
	}

	public void setIsDeptLeader(Integer isDeptLeader){
		this.isDeptLeader = isDeptLeader;
	}

	public Long getId(){
		return id;
	}

	public void setId(Long id){
		this.id = id;
	}

	public String getUserName(){
		return userName;
	}

	public void setUserName(String userName){
		this.userName = userName;
	}

	public String getPassword(){
		return password;
	}

	public void setPassword(String password){
		this.password = password;
	}

	public void setOriginalPassword(String password){
		if (password == null || "".equals(password)) {
			this.password = null;
		} else {
			this.password = MD5Support.MD5(password);
		}
	}

	public Role getRole(){
		return role;
	}

	public void setRole(Role role){
		this.role = role;
	}

	public String getRealName(){
		return realName;
	}

	public void setRealName(String realName){
		this.realName = realName;
	}

	public Integer getOperatorStatus(){
		return operatorStatus;
	}

	public void setOperatorStatus(Integer operatorStatus){
		this.operatorStatus = operatorStatus;
	}

	public String getSecretCode(){
		return secretCode;
	}

	public void setSecretCode(String secretCode){
		this.secretCode = secretCode;
	}

	public String getPhone(){
		return phone;
	}

	public void setPhone(String phone){
		this.phone = phone;
	}

	public String getEmail(){
		return email;
	}

	public void setEmail(String email){
		this.email = email;
	}

	public Date getCreateTime(){
		return createTime;
	}

	public void setCreateTime(Date createTime){
		this.createTime = createTime;
	}

	public List<Long> getCategoryIdsList(){
		return categoryIdsList;
	}

	public void setCategoryIdsList(List<Long> categoryIdsList){
		this.categoryIdsList = categoryIdsList;
	}

	public Integer getCategoryAllFlag(){
		categoryAllFlag = BaseModelAdapter.FLAG_NO;
		return categoryAllFlag;
	}

	public void setCategoryAllFlag(Integer categoryAllFlag){
		this.categoryAllFlag = categoryAllFlag;
	}

	public Integer getAdminSiteId(){
		return adminSiteId;
	}

	public void setAdminSiteId(Integer adminSiteId){
		this.adminSiteId = adminSiteId;
	}

	public Integer getCurrentSiteId(){
		return currentSiteId;
	}

	public void setCurrentSiteId(Integer currentSiteId){
		this.currentSiteId = currentSiteId;
	}

	public String getMerchantIdStr(){
		return merchantIdStr;
	}

	public void setMerchantIdStr(String merchantIdStr){
		this.merchantIdStr = merchantIdStr;
	}

	public Integer getMerchantAllFlag(){
		return merchantAllFlag;
	}

	public void setMerchantAllFlag(Integer merchantAllFlag){
		this.merchantAllFlag = merchantAllFlag;
	}

	public Integer getMcSiteId(){
		return mcSiteId;
	}

	public void setMcSiteId(Integer mcSiteId){
		this.mcSiteId = mcSiteId;
	}

	public Integer getUserType(){
		return userType;
	}

	public void setUserType(Integer userType){
		this.userType = userType;
	}

	// ~ method ===================================================

	/**
	 * @see java.lang.Object#toString()
	 */
	/*
	 * public String toString() { return new ToStringBuilder(this) .append("id", this.id) .append("secretCode",
	 * this.secretCode) .append("operatorStatus", this.operatorStatus) .append("roleId", (this.role != null) ?
	 * role.getId() : null) .append("createTime", this.createTime) .append("phone", this.phone) .append("realName",
	 * this.realName) .append("department", this.department) .append("password", this.password) .append("email",
	 * this.email) .append("userName", this.userName) .toString(); }
	 */

}
